// @ts-nocheck
import { Controller } from 'egg';

export default class HomeController extends Controller {
  public async index() {
    const { ctx } = this;
    await ctx.render('index.html');
  }
  async proxy() {
    const { ctx } = this;
    // use roadhog mock api first
    const url = this.app.config.assets.url + ctx.path + '?' + ctx.querystring;
    console.log('url', url)
    const res = await ctx.curl(url, {
      method: ctx.method,
    });
    console.log('url', String(res.data))
    ctx.body = res.data;
    ctx.status = res.status;
  }
}
